﻿using System.Runtime.InteropServices;
using System.Runtime.Serialization;

namespace Authorization
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.Interop.Security.AzRoles;

    /// <summary>
    /// Objeto contendo as permissoes atribuidas a um usuario.
    /// Jose Mauro - Rerum 18/05/2011 IM120338
    /// </summary>
    [DataContract(Name = "RoleAssignmentUser", Namespace = "http://authorizationservices/v1")]
    public class RoleAssignmentUser
    {

        #region Properties

        /// <summary>
        /// Login do usuario.
        /// </summary>
        [DataMember(Name = "Username", IsRequired = false)]
        public string Username  { get; set; }

        /// <summary>
        /// Nome da aplicacao.
        /// </summary>
        [DataMember(Name = "Application", IsRequired = false)]
        public string Application { get; set; }

        /// <summary>
        /// Escopo da Aplicacao.
        /// </summary>
        [DataMember(Name = "Scope", IsRequired = false)]
        public string Scope  { get; set; }

        /// <summary>
        /// Regra atribuida.
        /// </summary>
        [DataMember(Name = "RoleAssignment", IsRequired = false)]
        public string RoleAssignment { get; set; }

        #endregion

        #region Constructors

        internal RoleAssignmentUser(string pUsername, string pApplication, string pScope, string pRoleAssignment)
        {
            Username = pUsername;
            Application = pApplication;
            Scope = pScope;
            RoleAssignment = pRoleAssignment;
        }

        #endregion

    }
}
